<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Create a new account</title>
</head>
<body>
<jsp:include page="links.html"></jsp:include>
<form name="createAccountForm" action="/BankWeb/BankServlet" method="POST">
Please give account details: <br/>
	<table>
		<tr>
		<td> Account Number: </td>
		<td> <input type="text" name="accountID" /> </td>
		</tr>
		<tr>
		<td> First Name: </td>
		<td> <input type="text" name="firstName" /> </td>
		</tr>
		<tr>
		<td> Last Name: </td>
		<td> <input type="text" name="lastName" /> </td>
		</tr>
		<tr>
		<td> Address: </td>
		<td> <input type="text" name="address" /> </td>
		</tr>
		<tr>
		<td> Phone: </td>
		<td> <input type="text" name="phone" /> </td>
		</tr>
		<tr>
		<td> Starting balance: </td>
		<td> <input type="text" name="balance" /> </td>
		</tr>
		<tr>
		<td> <input type="hidden" name="action" value="CREATE" /> </td>
		<td> <input type="submit" name="Submit" value="Create new account" /> </td>
		</tr>
	</table>
	<hr/>
	<% 
	
	String createResp = null;
	try{
		createResp  = (String) session.getAttribute("BankServlet.createResponse"); //we put it inside try catch because there might be some value other than string inside
	}catch(Exception ex){
		
	}
	if(createResp!=null) {
	%>
	<center>
	<br/>
	<b>
	<%= createResp %>
	<%session.setAttribute("BankServlet.createResponse", null); %>
	</b>
	</center>
	<%} %>
</form>
</body>
</html>